<?
		


	include ("configuration/informations.php3");

	$Date = date("d/m/Y");
		
	$mysql_link = mysql_connect($Hote, $Login, $Pass_mysql);
	mysql_select_db($Base);

	$query = "SELECT * FROM $TableBannieres WHERE ID='$IDBan' "; 
	$mysql_result = mysql_query($query, $mysql_link);
	
	while($row = mysql_fetch_row($mysql_result))
	{	
		$B_ID = $row[0];
		$B_Poids = $row[4];
		$B_Debut = $row[5];
		$B_Fin = $row[6];
		$B_Fin_method = $row[7];
		$B_Site = $row[8];
		$B_Banniere = $row[9];
		$B_Fenetre = $row[10];
		$B_Largeur = $row[11];
		$B_Hauteur = $row[12];
		$B_Epaisseur = $row[13];
		$B_Commentaire = $row[14];
		$B_Texte = $row[15];
		$B_RichMedia = $row[16];
		$B_NbClics = $row[18];
		$B_NbAffichages = $row[19];
	}
		
	$Nb_clics_actu = ($B_NbClics + 1);
	$query = "UPDATE $TableBannieres SET NbClics='$Nb_clics_actu' WHERE ID='$IDBan' "; 
	$mysql_result = mysql_query($query, $mysql_link);
	
	$query = "SELECT * FROM $TableStats WHERE IDBan='$IDBan' AND Date='$Date' ";
	$mysql_result = mysql_query($query, $mysql_link);
	while($row = mysql_fetch_row($mysql_result))
	{		
		$S_ID = $row[0];
		$S_NbClicsJour = $row[3];
	}
	
	$S_NbClicsJour = ($S_NbClicsJour + 1);
	
	$query2 = "UPDATE $TableStats SET NbClicsJour='$S_NbClicsJour' WHERE IDBan='$IDBan' AND Date='$Date' "; 
	$mysql_result2 = mysql_query($query2, $mysql_link);
	
header("Location: $B_Site");
?>
